
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="IE=edge" >
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
<title>视频播放</title>
<script src="__ADMIN_JS__/core/jquery.min.js"></script>
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.7/skins/default/aliplayer-min.css" />
<script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.8.7/aliplayer-min.js"></script>
<link rel="stylesheet" href="{:config('static_url')}/public/static/libs/weui/lib/mui.min.css" />
<script src="__LIBS__/layer/layer.js?v={:config('asset_version')}"></script>
<link rel="stylesheet" href="__ADMIN_CSS__/bootstrap.min.css">
<link rel="stylesheet" id="css-theme" href="__ADMIN_CSS__/themes/{:config('system_color')}.min.css">
</head>
<body>

{if condition="$videoInfo['cPlayId'] != $videoInfo['PlayId'] or $videoInfo['sPlayId'] > 0"}
	{if condition="$videoInfo['sPlayId'] == 0"}
		<button  class="btn btn-sm btn-primary" type="button" id='detailsLong' style='position: absolute;z-index:999'>查看完版视频</button>
	{else}
		<button  class="btn btn-sm btn-primary" type="button" id='detailsshort' style='position: absolute;z-index:999'>查看精华版视频</button>
	{/if}
{/if}
<div class="prism-player" id="player-con"></div>

<script>
var player = new Aliplayer({
  "id": "player-con",
  "vid": "{$videoInfo['VideoId']}",
  "playauth": "{$videoInfo['PlayAuth']}",
  "qualitySort": "asc",
  "format": "m3u8,mp4",
  "mediaType": "video",
  "width": "100%",
  "height": "500px",
  "autoplay": true,
  "isLive": false,
  "rePlay": false,
  "playsinline": true,
  "preload": true,
  "controlBarVisibility": "hover",
  "useH5Prism": true
}, function (player) {
    console.log("The player is created");
  }
);
</script>



<table class="table table-builder table-hover table-bordered table-striped js-table-checkable-target" style ="margin:10px">
  <caption>预置评论</caption>
  <caption>
  <input style='width:50%;' class="form-control" type="text" id="contentSubmit" name="web_site_slogan" value="" placeholder="请输入评论" >
  <br/>
  <button  class="btn btn-sm btn-primary" type="button" id='commentSubmit'>添加预置评论</button>
  
  <button  class="btn btn-sm btn-primary" type="button" id='commentClick'>查看预置评论</button>
  </caption>
</table>
<table class="table table-builder table-hover table-bordered table-striped js-table-checkable-target" style ="margin:10px">
  <caption>视频详情信息</caption>
  <thead>
    <tr>
      <th class="col-xs-6 col-sm-3">视频详情 </th>
      <th><button  class="btn btn-sm btn-primary" type="button" id='edit'>视频编辑</button></th>
    </tr>
  </thead>
  <tbody>
  
    <tr>
      <td>视频id</td>
      <td>{$videoInfo['PlayId']}</td>
    </tr>
    <tr>
      <td>视频标题</td>
      <td>{$videoInfo['Title']}</td>
    </tr>
    <tr>
      <td>视频描述</td>
      <td>{$videoInfo['Describe']}</td>
    </tr>
    <tr>
      <td>视频标识VideoId</td>
      <td>{$videoInfo['VideoId']}</td>
    </tr>
    <tr>
      <td>视频时长</td>
      <td>{$videoInfo['Duration']}</td>
    </tr>
    <tr>
      <td>视频分类</td>
      <td>{$videoInfo['ClassTitle']}</td>
    </tr>
    <tr>
      <td>视频来源</td>
      <td>{$videoInfo['IsOriginal']}</td>
    </tr>
    <tr>
      <td>首页推荐</td>
      <td>{$videoInfo['IsRecommend']}</td>
    </tr>
    <tr>
      <td>视频类型</td>
      <td>{$videoInfo['PlayType']}</td>
    </tr>
    <tr>
      <td>点赞数</td>
      <td>{$videoInfo['support_times']}</td>
    </tr>
    <tr>
      <td>评论数</td>
      <td>{$videoInfo['comment_times']} <button  class="btn btn-sm btn-primary" type="button" id='commentlistClick'>评论列表</button></td>
    </tr>
    <tr>
      <td>举报数</td>
      <td>{$videoInfo['report_times']}</td>
    </tr>
    <tr>
      <td>视频标签</td>
      <td>{$videoInfo['label_str']}</td>
    </tr>
    
  </tbody>
</table>
<table class="table table-builder table-hover table-bordered table-striped js-table-checkable-target " style ="margin:10px">
<caption>视频播放数据统计</caption>
  <thead>
    <tr>
      <th class="col-xs-6 col-sm-3">数据统计 </th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>播放次数</td>
      <td>{$videoInfo['video_plays']}次</td>
    </tr>
    <tr>
      <td>视频总时长</td>
      <td>{$videoInfo['Duration']}</td>
    </tr>
    <tr>
      <td>平均播放时长</td>
      <td>{$videoInfo['video_plays_average']}</td>
    </tr>
    <tr>
      <td>播放时长 小于10%播放次数（百分占比）</td>
      <td>{$videoInfo['video_plays_10t']}次({$videoInfo['video_plays_10b']})（完全不感兴趣）</td>
    </tr>
    <tr>
      <td>播放时长 介于10%~30%播放次数（百分占比）</td>
      <td>{$videoInfo['video_plays_30t']}次({$videoInfo['video_plays_30b']})（简单了解）</td>
    </tr>
    <tr>
      <td>播放时长 介于30%~60%播放次数（百分占比）</td>
      <td>{$videoInfo['video_plays_60t']}次({$videoInfo['video_plays_60b']})（略有兴致）</td>
    </tr>
    <tr>
      <td>播放时长 介于60%~90%播放次数（百分占比）</td>
      <td>{$videoInfo['video_plays_90t']}次({$videoInfo['video_plays_90b']})（感兴趣）</td>
    </tr>
    <tr>
      <td>播放时长 大于90%播放次数（百分占比）</td>
      <td>{$videoInfo['video_plays_100t']}次({$videoInfo['video_plays_100b']})（完整观看）</td>
    </tr>
  </tbody>
</table>
<table class="table table-builder table-hover table-bordered table-striped js-table-checkable-target " style ="margin:10px">
  <caption>视频资源列表</caption>
  
  
  {foreach $list_video as $key=>$vo } 
      <thead>
        <tr>
          <th class="col-xs-6 col-sm-3">【{$vo.Definition}】</th>
          <th></th>
        </tr>
      </thead>
      <tbody>
        
        <tr>
          <td>视频大小</td>
          <td>{$vo.Size}</td>
        </tr>
        <tr>
          <td>分辨率</td>
          <td>{$vo.Width}*{$vo.Height}</td>
        </tr>
        <tr>
          <td>视频FPS</td>
          <td>{$vo.FPS}</td>
        </tr>
        <tr>
          <td>视频格式</td>
          <td>{$vo.Format}</td>
        </tr>
        <tr>
          <td>视频码率</td>
          <td>{$vo.Bitrate}Kbps</td>
        </tr>
      </tbody>
  {/foreach}
  

</table>
</body>
<script>
$("#contentSubmit").keydown(function(e) {  
	if (e.keyCode == 13) {
		var content = $('#contentSubmit').val();
		var play_id = "{$videoInfo['cPlayId']}";
		if(content != ''){
			$.post("{:url('Commentartificial/comment')}", {play_id:play_id, content:content}, function(data) {
				//提示层
				layer.msg('添加评论成功');
				$('#contentSubmit').val('');
				console.log(data);
			})
		}else{
        //提示层
        layer.tips('Hi，评论内容不能为空哟😄', '#contentSubmit');
    }
	}  
});
$("#commentSubmit").click(function(e) {  
	var content = $('#contentSubmit').val();
	var play_id = "{$videoInfo['cPlayId']}";
	if(content != ''){
		$.post("{:url('Commentartificial/comment')}", {play_id:play_id, content:content}, function(data) {
			//提示层
			layer.msg('添加评论成功');
			$('#contentSubmit').val('');
			console.log(data);
		})
	}else{
        //提示层
        layer.tips('Hi，评论内容不能为空哟😄', '#contentSubmit');
				//layer.msg('请填写评论内容');
  }
});

$("#commentClick").click(function(e) {
	layer.open({
	  type: 2,
	  title: '预置评论列表',
	  shadeClose: true,
	  shade: 0.8,
	  area: ['95%', '95%'],
	  content: "{:url('Commentartificial/comment_list',['play_id' => $videoInfo['cPlayId'], '_pop' => 1])}" //iframe的url
	}); 

	//window.location.href = "{:url('details', ['id' =>$videoInfo['PlayId']])}";
});

$("#commentlistClick").click(function(e) {
	layer.open({
	  type: 2,
	  title: '评论列表',
	  shadeClose: true,
	  shade: 0.8,
	  area: ['95%', '95%'],
	  content: "{:url('comment/index',['_select_field' => 'play_id', '_select_value' => $videoInfo['cPlayId'], '_pop' => 1])}" //iframe的url
	}); 

});
$("#edit").click(function(e) {
	layer.open({
	  type: 2,
	  title: '视频编辑',
	  shadeClose: true,
	  shade: 0.8,
	  area: ['95%', '95%'],
	  content: "{:url('index/edit',['id' => $videoInfo['PlayId'], '_pop' => 1])}" //iframe的url
	}); 

});

$("#detailsLong").click(function(e) {
	window.location.href = "{:url('details', ['id' =>$videoInfo['cPlayId'] ,'_pop' => 1])}";
});
$("#detailsshort").click(function(e) {
	window.location.href = "{:url('details', ['id' =>$videoInfo['sPlayId'] ,'_pop' => 1])}";
});
</script>
